#include<stdio.h>
#include<string.h>

int main(void)
{
	char word1[80];
	char word2[80]; 
	int i,j,k,t;
    char temp;
    
	scanf("%s",word1);
	scanf("%s",word2);
	
	for(i=0;i<strlen(word1)-1;i++)
	   for(j=0;j<strlen(word2)-i-1;j++)
	   {
	   	 if(word1[j]<word2[j+1])
	   	 {
	   	 	temp = word1[j];
	   	 	word1[j]=word1[j+1];
	   	 	word1[j+1]=temp;
	   	 }
	   }
    puts(word1);
		
	return 0;
} 
